package com.csun.cmny.provider.service.impl;

import com.csun.cmny.core.support.BaseService;
import com.csun.cmny.provider.dao.OmcRecreationFileMapper;
import com.csun.cmny.provider.dto.RecreationFileDto;
import com.csun.cmny.provider.dto.RecreationFileQueryDto;
import com.csun.cmny.provider.model.domain.OmcRecreationFile;
import com.csun.cmny.provider.service.OmcRecreationFileService;
import com.csun.cmny.provider.vo.OmcRecreationFileVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Lijun
 * @description:
 * @date 2019/11/25 11:17
 */
@Slf4j
@Service
@Transactional
public class OmcRecreationFileServiceImpl extends BaseService<OmcRecreationFile> implements OmcRecreationFileService {
    @Resource
    private OmcRecreationFileMapper omcRecreationFileMapper;

    /**
     * 分页查询娱乐文件
     * @param queryDto
     * @return
     */
    @Override
    public PageInfo queryFileWithPage(RecreationFileQueryDto queryDto){
        PageHelper.startPage(queryDto.getPageNum(),queryDto.getPageSize());
        List<OmcRecreationFileVo> list = omcRecreationFileMapper.queryFileWithPage(queryDto);
        return new PageInfo<>(list);
    }

    @Override
    public Integer updateFile(RecreationFileDto fileDto){
        return omcRecreationFileMapper.updateFile(fileDto);
    }
}
